﻿using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UI
{
    public partial class classinfoadd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var name = Name.Value;
            var comment = Comment.Text;
            classinfo info = new classinfo()
            {
                Name = name,
                Comment = comment
            };
            Classinfo_BLL bll = new Classinfo_BLL();
            if (bll.add(info) > 0)
            {
                Response.Write("<script>alert('添加成功');location.href='/classinfo.aspx';</script>");
            }
        }
    }
}